/*
 * @Author: your name
 * @Date: 2021-10-18 17:35:30
 * @LastEditTime: 2021-10-20 23:04:14
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \led_sys_backup\main.c
 */
#include "stm32f10x.h"

#include "common.h"
#include "systick.h"
#include "uart.h"
#include "delay.h"
#include "iic.h"
#include <stdio.h>

void board_init(void)
{
	systick_init(72);
	uart_init(CHECK,UART1,115200);
	printf("sys init ok\r\n");
}

int main(void)
{
	char data[11] = {0}, j = 0;
	unsigned int i = 0;
	board_init();

	while (1)
	{
		if(i == 1000000)
		{
			printf("i am 1s\r\n");
			i = 0;
		}
			
		// delay_s(1);//1000000
		// printf("i am 1ms\r\n");
		// delay_ms(1);
		data[j++] = uart_recv_d();
		if(j)
			// printf("%s\r\n",data);
			// printf("%c",data[0]);
			uart_send_data(0,data,j);
		delay_us(1);
		i++;
	}
	


//	return 0;
}

